package router

import (
	"Founction/controller"

	"Founction/middlewares"
	"github.com/gin-gonic/gin"
)

func UserRouter(Router *gin.RouterGroup) {
	userRouter := Router.Group("user")
	{
		// 测试isadmin中间件 测试一个role为2的用户, 一定及得携带x-token字段的header!
		userRouter.GET("list", middlewares.JWTAuth(), middlewares.IsAdminAuth(), controller.GetUserList)
		// 登录
		userRouter.POST("login", controller.PasswordLogin)
		// 上传头像
		userRouter.POST("uploadImage", controller.PutHeaderImage)
	}
}
